﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib prefix="c"
uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
  <head>
    <link rel="stylesheet" href="${ctx}/common/common.css" />
    <title>检验报告</title>
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all" />
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>

    <script src="${ctx}/common/plugins/publicJs/publicJs.js"></script>
    <style>
      /*  .layui-body{overflow-y: scroll;} */
      body {
        overflow-y: scroll;
      }
    </style>
  </head>
  <body>
    <!--主体内容层-->
    <div class="layui-fluid">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12 layui-col-space15">
          <!--通用按钮盒子-->
          <div class="layui-col-md12" style="padding-top: 10px; padding-bottom: 10px">
            <!--通用table表格-->
            <div style="float: right" class="layui-btn-group paramBtn">
              <button class="layui-btn layui-btn-primary" onclick="goback()">返回</button>
            </div>
          </div>
          <table
            class="layui-table"
            id="inspectionReload"
            lay-data="{ url:'${ctx}/purchaseStatistics/findInspectionPage?recipientId=${recipientId}', page:false}"
            lay-filter="demo"
          >
            <thead>
              <tr>
                <!--   <th lay-data="{field:'id'}">报告主键</th> -->
                <th lay-data="{field:'code'}">检验单号</th>
                <th lay-data="{field:'name'}">检验产品</th>
                <th lay-data="{field:'product_batch'}">生产批次</th>
                <th lay-data="{field:'product_date'}">生产日期</th>
                <th lay-data="{field:'inspPerson'}">检验人员</th>
                <th lay-data="{field:'insp_type'}">检验方式</th>
                <th lay-data="{field:'insp_org'}">检验机构</th>
                <th lay-data="{field:'insp_date'}">检验时间</th>
                <th lay-data="{field:'sample_size'}">样本量</th>
                <th lay-data="{field:'insp_result'}">检验结果</th>
                <th lay-data="{field:'right',toolbar:'#barInspectionView',width:100}">检验指标</th>
              </tr>
            </thead>
          </table>
        </div>
      </div>
    </div>
  </body>
  <script type="text/html" id="barInspectionView">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="inspectionView">查看</a>
  </script>
  <script>
    /*返回*/
    function goback() {
      window.history.back(-1);
    }
    layui.use(["tree", "layer", "table"], function () {
      var $ = layui.$;
      var loading = layer.msg("数据加载中...");
      var table = layui.table;
      table.render({
        done: function () {
          layer.close(loading);
        },
      });
      var ins;
      //监听filter为demo的table中的工具条
      table.on("tool(demo)", function (obj) {
        var data = obj.data;
        layer.open({
          type: 2,
          title: "查看",
          shadeClose: true,
          offset: "10px",
          shade: 0.8,
          area: ["50%", "80%"],
          content: "${ctx}/supervise/traceabilityQuery/inspectionView?id=" + data.id, //
        });
      });

      $(".demoTable .layui-btn").on("click", function () {
        var type = $(this).data("type");
        active[type] ? active[type].call(this) : "";
      });
      //给按钮绑定active中的方法
      $(".paramBtn .layui-btn").on("click", function () {
        var type = $(this).data("type");
        //查看是active这个json中是否有type这个方法，如果有调用，如果没有不知心；
        active[type] ? active[type].call() : "";
      });
    });
  </script>
</html>
